<template>
  <!-- 商品列表 -->
  <div class="maillList">
    <div class="mall" v-for="(item ,index) in mall_List" :key="index" @click="toMalldetail(item)">
      <div class="mallImg">
        <div
          class="mallImg_top"
          v-if="item.tag_name && item.tag_name !== null"
        >{{item.tag_name?item.tag_name:''}}</div>
        <img v-if="item.thumb_image" :src="imgUrl+item.thumb_image" class="img" />
        <img v-if="item.images" :src="imgUrl+item.images" class="img" />
        <div v-if="item.activity_status == 1" class="shop_type">即将开抢</div>
        <div v-if="item.activity_status == 2" class="shop_type">抢购中</div>
      </div>
      <h5 class="mall_name">
        <span v-if="item.cross_border == 1" class="icon"></span>
        {{item.title}}
      </h5>
      <div class="text1">
        <p class="original_price">
          <span
            class="pay_price"
            v-if="item.deduction_credit<=0 || (item.price!=item.deduction_credit&&item.price>0)"
          >
            <span class="money_cent">￥</span>
            {{item.price}}
          </span>
          <span class="jyb" v-if="item.deduction_credit_type!=0&&item.deduction_credit_type!=0">
            <span v-if="item.price>0&&item.price!=item.deduction_credit" class="font_jyb"></span>
            <span :class="item.deduction_credit_type==1?'jb_icon':'yb_icon'">
              {{item.deduction_credit}}
              <span class="icon"></span>
            </span>
          </span>
        </p>
        <p
          class="plus"
          v-if="item.plus_title&&item.plus_title!=''&&item.activity_status != 2"
        >{{item.plus_title}}</p>
        <p class="pirce_num">
          <span class="ms_icon">
            <span v-if="item.cross_border==1">跨境</span>
            <span v-if="item.activity_status == 2">秒杀</span>
          </span>
          <span class="sell_num">销量{{item.sales_num}}</span>
        </p>
      </div>
    </div>
    <div class="zhanwei"></div>
  </div>
</template>

<script>
import common from "@/assets/js/mmk_common.js";
export default {
  data() {
    return {
      imgUrl: common.image_response
    };
  },
  props: {
    mall_List: ""
  },
  methods: {
    //到积分商城商品详情
    toMalldetail(params) {
      wx.navigateTo({
        url: `/pages/package_mall/goods_detail/main?goods_id=${
          params.id
        }&title=${params.title}`
      });
    }
  }
};
</script>

<style scoped lang="less">
/* 商品列表样式 */
.maillList {
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  // display: flex;
  // justify-content: space-between;
  columns: 2;
  flex-wrap: wrap;
  // flex-direction: row;
  
  .mall {
    position: relative;
    margin-bottom: 7px;
    background: #fff;
    padding-bottom: 2px;
    border-radius: 6px;
    box-sizing: border-box;
    width: 175px;
    height: auto;
    display: inline-block;
    &:last-of-type {
      margin-bottom: 10px;
    }
    &:nth-child(2n + 1) {
      margin-right: 6px;
    }
    .mallImg {
      width: 100%;
      height: 170px;
      position: relative;
      .mallImg_top {
        background: url("https://h5.ameimeika.com/mp_images/mp_2.7/icon_intergralmall_list_tag.png")
          no-repeat;
        background-size: 100% 100%;
        line-height: 15px;
        height: 22px;
        text-align: center;
        position: absolute;
        top: -4px;
        left: -4px;
        font-size: 9px;
        font-family: "Medium";
        font-weight: 500;
        color: rgba(255, 255, 255, 1);
        padding: 0 2px;
      }
      .img {
        width: 100%;
        height: 170px;
        border-radius: 6px 6px 0 0;
      }
      .shop_type {
        position: absolute;
        right: 6px;
        bottom: 6px;
        width: 80px;
        text-align: center;
        color: #fff;
        background: linear-gradient(
          213deg,
          rgba(255, 134, 105, 1) 0%,
          rgba(254, 106, 156, 1) 100%
        );
        border-radius: 20px;
        padding: 4px 0;
      }
    }
    .mall_name,
    .mall_dic {
      width: 100%;
      height: 40px;
      font-size: 14px;
      color: #333;
      margin-top: 7px;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      box-sizing: border-box;
      padding: 0 6px;
      .icon {
        width: 40px;
        height: 14px;
        display: inline-block;
        background: url("https://img.ameimeika.com/h5_images/mp_images/mp_3.0/mall/kuajing.png")
          no-repeat;
        background-size: 100% 100%;
      }
    }
    .text1 {
      width: 94%;
      position: relative;
      padding: 0 4px;
      .original_price {
        font-size: 12px;
        font-weight: 400;
        color: #f64665;
        line-height: 17px;
        margin: 6px 0 4px;
        display: flex;
        align-items: center;
        .pay_credit {
          color: #ff7100;
        }
        .pay_price {
          color: #f64665;
          font-size: 16px;
          font-family: PingFangSC-Medium, PingFang SC;
          font-weight: 500;
          display: flex;
          align-items: flex-end;
          line-height: 20px;
          .money_cent {
            font-size: 12px;
            line-height: 18px;
          }
        }
        .point {
          width: 53px;
          height: 14px;
          background: rgba(255, 224, 224, 1);
          border-radius: 7px;
          display: inline-block;
          text-align: center;
          line-height: 14px;
          color: #fff;
          font-size: 10px;
          padding: 0 3px;
        }
        .jyb {
          width: auto;
          height: auto;
          font-size: 10px;
          font-weight: 500;
          color: rgba(202, 202, 202, 1);
          line-height: 20px;
          display: flex;
          align-items: center;
          .font_jyb {
            width: 6px;
            height: 6px;
            background: url("https://mmkapp.oss-cn-beijing.aliyuncs.com/h5_images/mp_images/mp_3.1.6/mmk_3.1.6/jyb_add.png")
              center center no-repeat;
            background-size: 6px 6px;
            margin: 0 2px;
          }
          .jb_icon {
            color: rgba(245, 208, 64, 1);
            font-size: 16px;
            line-height: 20px;
            display: flex;
            align-items: center;
            .icon {
              display: block;
              width: 15px;
              height: 15px;
              background: url("https://mmkapp.oss-cn-beijing.aliyuncs.com/h5_images/mp_images/mp_3.1.6/mmk_3.1.6/gold_icon.png")
                0 center no-repeat;
              background-size: 15px 15px;
              margin-left: 1px;
              margin-top: -1px;
            }
          }
          .yb_icon {
            color: rgba(190, 204, 206, 1);
            font-size: 16px;
            line-height: 20px;
            display: flex;
            align-items: center;
            .icon {
              display: block;
              margin-left: 1px;
              width: 15px;
              height: 15px;
              background: url("https://mmkapp.oss-cn-beijing.aliyuncs.com/h5_images/mp_images/mp_3.1.6/mmk_3.1.6/silver_icon.png")
                0 center no-repeat;
              background-size: 15px 15px;
              margin-top: -1px;
            }
          }
        }
      }
      .pirce_num {
        width: 100%;
        font-size: 10px;
        line-height: 14px;
        color: #999;
        margin-bottom: 9px;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        .price {
          text-decoration: line-through;
        }
        .sell_num {
          font-size: 10px;
          color: #666666;
          opacity: 0.6;
        }
        .ms_icon {
          display: flex;
          flex-direction: row;
          span {
            display: block;
            font-size: 9px;
            font-family: PingFangSC-Regular, PingFang SC;
            font-weight: 400;
            color: rgba(255, 56, 62, 1);
            line-height: 10px;
            background: rgba(255, 56, 62, 0.08);
            border-radius: 2px;
            padding: 0 2px;
            margin-right: 2px;
          }
        }
      }
      .plus {
        text-align: center;
        padding: 0 5px;
        margin: 9px 0;
        line-height: 18px;
        font-size: 10px;
        font-family: "PingFangSC-Medium", "PingFang SC";
        font-weight: 500;
        color: rgba(87, 66, 66, 1);
        height: 18px;
        background: rgba(255, 241, 216, 1);
        border-radius: 5px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
      }
    }
  }
  .zhanwei {
    width: 100%;
    height: 100px;
  }
}
</style>
